var express = require('express');
var router = express.Router();

var api = require("../../../utils/api");

//获取外勤签到信息
router.get('/', function (req, res, next) {
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/outworks.json";
    res.json(api.api.request(path));
});

//获取外勤签到规则
router.get('/rules', function (req, res, next) {
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/rules.json";
    res.json(api.api.request(path));
});
//提交外勤签到
router.post('/',function(req,res){
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/index.json";
    res.json(api.api.request(path));
});

//获取下级签到列表
router.get('/subworks',function(req,res,next){
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/subworks.json";
    res.json(api.api.request(path));
});


module.exports = router;